<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>
        <ul id="ul">

        </ul>
    </div>
    <script src="../0505/js/jq.js"></script>
    <script>
        $(function () {

            window.onload = function () {
                $.ajax({
                    url: 'http://localhost:3000/useing/master',
                    //  请求类型 是get（默认）或者post
                    type: 'get',
                    // data 有数据就放在data中
                    success: function (res) {
                        var str = '';
                        $.each(res, function (index, item) {
                            // $each中第一个是下标，第二个是数据
                            str += "<li>" +
                                "<img src=" + item.img + ">" +
                                "<p>" + item.endTime + "</p>" +
                                "<p>" + item.text + "</p>" +
                                "</li>"
                        })
                        $('#ul').html(str)
                    }
                })
            }

        })
    </script>
</body>

</html>